package org.yu.api.register;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.Mob;
import net.minecraftforge.common.ForgeSpawnEggItem;

public class MobEntityTypeBuilder<T extends Mob> extends LivingTypeBuilder<T>{
    protected int eggBackgroundColor=0,eggHighlightColor=0;
    public MobEntityTypeBuilder(LazyRegistry lazyRegistry, String name, EntityType.EntityFactory<T> factory) {
        super(lazyRegistry, name, factory);
    }
    public EntityTypeBuilder<T> egg(int eggBackgroundColor,int eggHighlightColor){
        this.eggBackgroundColor=eggBackgroundColor;
        this.eggHighlightColor=eggHighlightColor;
        return this;
    }

    @Override
    public EntityTypeHolder<T> build() {
        super.build();
        lazyRegistry.item(name,properties -> new ForgeSpawnEggItem(result.type,eggBackgroundColor,eggHighlightColor,properties)).build();
         return result;
    }
}
